﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="messageCustomerService.aspx.cs" Inherits="WebApp.admin.message.messageCustomerService" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>在线客服</title>
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
</head>

<script type="text/javascript" src="../js/main.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.js"></script>

<script type="text/javascript">
    ///添加表单选项
    function AddCustomerService(obj) {
        var tb = document.getElementById("CustomerService");
        newRow = tb.insertRow(tb.rows.length);
        newRow.width = "100%";
        newCell1 = newRow.insertCell(0);
        if (obj == "0")
            newCell1.innerHTML = "QQ：<input name=\"hdCustomerService\" type=\"hidden\" value=\"0\" /><input name=\"customerServiceType\" type=\"hidden\" value=\"0\" />";
        if (obj == "1")
            newCell1.innerHTML = "MSN：<input name=\"hdCustomerService\" type=\"hidden\" value=\"0\" /><input name=\"customerServiceType\" type=\"hidden\" value=\"1\" />"
        if (obj == "2")
            newCell1.innerHTML = "旺旺：<input name=\"hdCustomerService\" type=\"hidden\" value=\"0\" /><input name=\"customerServiceType\" type=\"hidden\" value=\"2\" />";
        if (obj == "3")
            newCell1.innerHTML = "Skype：<input name=\"hdCustomerService\" type=\"hidden\" value=\"0\" /><input name=\"customerServiceType\" type=\"hidden\" value=\"3\" />";

        newCell2 = newRow.insertCell(1);
        if (obj == "0")
            newCell2.innerHTML = "<input name=\"customerServiceNo\" type=\"text\" /> 标题：<input name=\"title\" type=\"text\" /><input type=\"button\" class=\"formButton\" value=\"-\" title=\"删除客服\" onclick=\"delCustomerService(this.parentNode.parentNode.rowIndex)\">";
        if (obj == "1")
            newCell2.innerHTML = "<input name=\"customerServiceNo\" type=\"text\" /> 标题：<input name=\"title\" type=\"text\" /><input type=\"button\" class=\"formButton\" value=\"-\" title=\"删除客服\" onclick=\"delCustomerService(this.parentNode.parentNode.rowIndex)\">";
        if (obj == "2")
            newCell2.innerHTML = "<input name=\"customerServiceNo\" type=\"text\" /> 标题：<input name=\"title\" type=\"text\" /><input type=\"button\" class=\"formButton\" value=\"-\" title=\"删除客服\" onclick=\"delCustomerService(this.parentNode.parentNode.rowIndex)\">";
        if (obj == "3")
            newCell2.innerHTML = "<input name=\"customerServiceNo\" type=\"text\" /> 标题：<input name=\"title\" type=\"text\" /><input type=\"button\" class=\"formButton\" value=\"-\" title=\"删除客服\" onclick=\"delCustomerService(this.parentNode.parentNode.rowIndex)\">";
    }
    ///删除表单选项
    function delCustomerService(index) {
        if (confirm("确定要删除吗？"))
            document.getElementById("CustomerService").deleteRow(index);
    }
</script>

<body class="body">
    <table class="main" cellpadding="0" cellspacing="0">

        <tr>
            <td class="td_middle_middle">
                <div class="maincontent">
                    <form id="form1" runat="server">
                        <table cellpadding="0" cellspacing="0" style="width: 100%">
                            <tr>
                                <td class="td_title">
                                    在线客服标题：</td>
                                <td class="td_content">
                                    <input id="txtCustomerServiceTitle" type="text" runat="server" maxlength="20" />*</td>
                            </tr>
                            <tr>
                                <td class="td_title">
                                    是否启用：</td>
                                <td class="td_content">
                                    <input id="rdIsState1" name="isState" type="radio" runat="server" value="1" />是&nbsp;&nbsp;<input
                                        id="rdIsState0" name="isState" type="radio" runat="server" value="0" />否
                                </td>
                            </tr>
                            <tr>
                                <td class="td_title">
                                    添加在线客服：</td>
                                <td class="td_content">
                                    <input id="btnAddQQ" type="button" class="formButton" value="添加QQ" onclick="AddCustomerService('0');" />
                                    <input id="btnAddMSN" type="button" class="formButton" value="添加MSN" onclick="AddCustomerService('1');" />
                                    <input id="btnAddWangWang" type="button" class="formButton" value="添加旺旺" onclick="AddCustomerService('2');" />
                                    <input id="btnAddSkype" type="button" class="formButton" value="添加Skype" onclick="AddCustomerService('3');" />
                                </td>
                            </tr>
                            <tr>
                                <td class="td_title">
                                </td>
                                <td class="td_content">
                                    <%Response.Write(GetCustomerService()); %>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <asp:Button ID="btnSubmit" runat="server" Text="确  定" CssClass="formButton" OnClick="btnSubmit_Click"
                                        OnClientClick="return checkCustomerServiceForm();" /></td>
                            </tr>
                        </table>
                    </form>
                </div>
            </td>

        </tr>

    </table>
</body>
</html>
